//
//  MSPictureShowViewController.m
//  Weshare
//
//  Created by Mike on 16/9/19.
//  Copyright © 2016年 wxwl. All rights reserved.
//

#import "MSPictureShowViewController.h"
#import "HDImagesZoomView.h"

@interface MSPictureShowViewController ()
@property (nonatomic, strong) GXButton *backButton;
@property (nonatomic, strong) NSMutableArray *commentImageArr;
@property (nonatomic, strong) HDImagesZoomView *photoView;
@end

@implementation MSPictureShowViewController

- (void)initNavigationBar {
    self.contentView=[[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, SCREENWIDTH, SCREEN_HEIGHT)];
    self.contentView.clipsToBounds = YES;
    self.contentView.scrollEnabled = YES;
    self.contentView.backgroundColor = [UIColor yellowColor];
    [self.view addSubview:self.contentView];
    
    _navBarView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREENWIDTH, 64)];
    _navBarView.backgroundColor = [UIColor clearColor];
    [self.view addSubview:_navBarView];
}

- (void)initUI {
    self.photoView = [[HDImagesZoomView alloc] initWithFrame:SCREENFRAME];
    self.photoView.isRotate = NO;
    [self.photoView _initView];
    self.photoView.imageViewType = MSImageViewTypeComment;
    [self.contentView addSubview:self.photoView];
    
    _backButton = [GXButton buttonWithType:UIButtonTypeCustom];
    [_backButton setFrame:CGRectMake(10, 22, 40, 40)];
    _backButton.imageViewFrame = CGRectMake(7, 7, 26, 26);
    _backButton.relayout = YES;
    _backButton.layer.masksToBounds = YES;
    _backButton.layer.cornerRadius = _backButton.width/2;
    [_backButton setImage:[UIImage imageNamed:@"house_back"] forState:UIControlStateNormal];
    [_backButton addTarget:self action:@selector(leftBarBtnAction) forControlEvents:UIControlEventTouchUpInside];
    [_navBarView addSubview:_backButton];
}

- (void)testDataFunc{
    _commentImageArr = [[NSMutableArray alloc] init];
    for (int i = 0; i < self.imageArr.count; i++) {
        MSImage *image = [[MSImage alloc] init];
        image.url = self.imageArr[i];
        [_commentImageArr addObject:image];
    }
    self.photoView.dataArray = _commentImageArr;
    self.photoView.imageIndex = self.imageIndex;
}

- (void)leftBarBtnAction {
    [rootNavigation popViewControllerAnimated:YES];
}

@end
